package com.zrf.testchatgpt.service.impl;

import com.zrf.testchatgpt.entity.Role;
import com.zrf.testchatgpt.mapper.RoleMapper;
import com.zrf.testchatgpt.service.IRoleService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class RoleServiceImpl implements IRoleService {
    @Autowired
    RoleMapper roleMapper;

    @Override
    public List<Role> queryByUserId(Integer userid) {
        return roleMapper.queryByUserId(userid);
    }

    @Override
    public int updateRoleById(String userId,List<Integer> list) {
        return roleMapper.updateRoleById(userId,list);
    }

    @Override
    public int deleteRoleById(String userId, List<Integer> list) {
        return roleMapper.deleteRoleById(userId,list);
    }

    @Override
    public int insertRole(String roleId, List<Integer> permissionId) {
        return roleMapper.insertRole(roleId,permissionId);
    }

    @Override
    public int deleteRoleP(String roleId, List<Integer> list) {
        return roleMapper.deleteRoleP(roleId,list);
    }

}
